package com.checkURL;

import java.net.HttpURLConnection;
import java.net.URL;

public class CheckURL {

	/**
	 * @param args
	 */
	public static void main(String args[]) {
		exists("http://www.boingboing.net");
	}

	public static void exists(String p_URLName) {
		System.out.println("Evaluando... " + p_URLName);
		try {
			HttpURLConnection.setFollowRedirects(false);
			HttpURLConnection con = (HttpURLConnection) new URL(p_URLName)
					.openConnection();
			con.setRequestMethod("HEAD");
			System.out.println("ResponseCode... " + con.getResponseCode() + "("
					+ con.getResponseMessage() + ")");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
